@extends('common.base-master')

@section('html-head')
    <!-- Bootstrap -->
    <script src="{{url('js/lib/bootstrap.min.js')}}"></script>
    <link href="{{url('css/bootstrap.min.css')}}" type="text/css" rel="stylesheet">
    <link href="{{url('css/project_details.css')}}" type="text/css" rel="stylesheet">
    <script src="{{url('js/project_details.js')}}"></script>
@endsection

@section('html-body')
<main>
<div class="wrapp">
		<section class="head">
			<div class="user-basic">
                <dl>
                    <dt><a href="#"><img src="{{route('Api.ProjectLogo.Show' , ['id'=>$project->id])}}" alt="项目Logo"/></a></dt>
                    <dd class="contain">
                        <h1 class="name"><strong>{{$project->project_name}}</strong></h1>
                        <p class="desc">{{$project->project_intro}}</p>
                        <p class="address">{{$project->province}}<em></em></p>
                        <p class="keyword">
                            @if($fields = $project->project_x_fields)
                                @foreach($fields as $field)
                                    {{$field->field}}
                                @endforeach
                            @endif
                        </p>
                    </dd>
                </dl>
			</div>
			<div class="handle">
                <ul>
                    <li><a href="#" class="y-btn">约谈</a></li>
                    <li class="share">
                        <a href="#">分享</a>
                        <div class="jiathis_style_32x32">
                            <ul>
                                <li><a class="jiathis_button_tsina"></a><i>新浪微博</i></li>
                                <li><a class="jiathis_button_tqq"></a><i>腾讯微博</i></li>
                                <li><a class="jiathis_button_qzone"></a><i>qq空间</i></li>
                                <li><a class="jiathis_button_weixin"></a><i>微信</i></li>
                                <!--<li><a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank"></a></li>-->
                                <!--<li><a class="jiathis_counter_style"></a></li>-->
                            </ul>
                        </div>
                    </li>
                    <!--focus1为移动端关注后-->
                    <!--focus2为pc端关注后-->
                    <li class="focus2"><a href="#">关注</a></li>
                </ul>
			</div>
		</section>
			
		<section class="data">
			<h2>公司数据</h2>
            <div class="column-1">
                <ul>
                    <li class="invest" data="{{$project->invet}}">需求融资：
                        @if($invet = $project->invet)
                            <em>￥{{$invet}}万</em>
                        @else
                            <em>暂无数据</em>
                        @endif
                    </li>
                    <li class="c_">当前融资：
                        @if($now_invest = $project->getNowInvestByProId($project->id))
                            <em>￥{{$now_invest}}万</em>
                        @else
                            <em>暂无数据</em>
                        @endif
                    </li>
                    <li class="r_">出让股份：
                        @if($stock = $project->sell_stock)
                            <em>{{$stock}}%</em>
                        @else
                            <em>暂无数据</em>
                        @endif
                    </li>
                </ul>
                @if($now_invest && $invet)
                    @if($progress = $now_invest / $invet)
                        <div class="progress">
                            <div class="progress-bar" role="progressbar" aria-valuenow="{{round($progress*100,2)}}" aria-valuemin="{{round($progress*100,2)}}"
                                 aria-valuemax="100" style="width: {{round($progress*100,2)}}%;">
                                {{round($progress*100,2)}}%
                            </div>
                        </div>
                    @endif
                @else
                    <div class="progress">
                        <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0"
                             aria-valuemax="0" style="width: 0%;">
                            0%
                        </div>
                    </div>
                @endif

            </div>
            <div class="column-2">
                <p>靠谱程度<em class="b_0"></em></p>
                <!-- star 为空-->
                <!-- star1 为 1个星星-->
                <!-- star2 为 2个星星-->
                <!-- star3 为 3个星星-->
                <!-- star4 为 4个星星-->
                <!-- star5 为 5个星星-->
                <!-- end -->
                @if($star = $project->star_layer)
                    <span class="star star{{$star}}"></span>
                @endif
            </div>
            <div class="column-3">
                <p>预估回报率<em class="b_1"></em></p>
                @if($repay_rate = $project->repay_rate)
                    <p class="color">{{$repay_rate}}倍</p>
                @else
                    <p class="color">暂无数据</p>
                @endif
            </div>
			<div class="column-4">
                <a href="{{route("Api.File.DownLoad" , ['id'=>$project->file_bp_id])}}" class="cv2">商业计划书</a>
			</div>
			
			<!-- 认证后消失 -->
			<div class="cover" style="display: none;">
				<div>
					<p>融资信息 仅投资人可见，认证后可约谈与创业者见面</p>
					<button>认证投资人</button>
				</div>
			</div>
			
			<!-- 不需要融资，约谈 创始人 -->
			<div class="cover cc-t" style="display: none;">
				<div>
					<p>该项目暂时不需要融资，如有需要可以 <b>约谈</b> 创始人</p>
				</div>
			</div>
		</section>
	
	<div class="table-col">
	<!--项目数据-->
	<div class="contain_">
        <section class="pro_data">
            <h2><em>项目数据</em></h2>
            <div class="col_1">
				<span>
                    @if($project->create_time)
                        <p class="row">{{date('Y-m',strtotime($project->create_time))}}</p>
                    @else
                        <p class="row">{{date('Y-m',strtotime($project->created_at))}}</p>
                    @endif
                    <p class="r-s">成立时间</p>
				</span>
				<span>
                    @if($count = count($project->project_x_team))
                        <p  class="row">{{$count}}个</p>
                    @else
                        <p  class="row">暂无数据</p>
                    @endif
                    <p class="r-s">团队数量</p>
				</span>
				<span class="dis">
					<p class="row">
                        @if($phase = $project->toPhase)
                            {{$phase->phase}}
                        @else
                            暂无数据
                        @endif
                    </p>
					<p class="r-s">项目阶段</p>
				</span>
            </div>
            <div class="col_2">
				<span>
                    @if($accounts = $project->getInvestAccountsByProjectId($project->id))
                        <p class="row">￥{{$accounts}}万</p>
                    @else
                        <p class="row">暂无数据</p>
                    @endif
                    <p class="r-s">投资金额</p>
				</span>
				<span>
                    @if($project->repay_rate > 0)
                        <p  class="row">{{$project->repay_rate}}倍</p>
                    @else
                        <p  class="row">暂无数据</p>
                    @endif
                    <p class="r-s">回报率</p>
				</span>
				<span class="dis">
					<p class="row">
                        @if($competes = $project->getCompeteById($project->id)){{$competes}}@else 10 @endif</p>
					<p class="r-s">竞争数量(个)</p>
				</span>
            </div>
        </section>
		<section class="viewport">
			<h3><em>项目总览</em></h3>
<div class="slide">
	<div class="gallery">
        <ul>
            @if($project->project_x_overview_img()->wherePivot('project_id','=',$project->id)->exists())
                @if($images = $project->project_x_overview_img)
                    @foreach($images as $image)
                        <li><img src="{{route('Api.Project.getProjectOverviewImgByImgId' , ['id'=>$image->id])}}" /></li>
                    @endforeach
                @endif
            @else
                <li class="fadein"><img src="{{url('images/banner_1.png')}}" /></li>
                <li class="fadeout"><img src="{{url('images/banner_1.png')}}" /></li>
                <li class="fadeout"><img src="{{url('images/banner_1.png')}}" /></li>
                <li class="fadeout"><img src="{{url('images/banner_1.png')}}" /></li>
                <li class="fadeout"><img src="{{url('images/banner_1.png')}}" /></li>
            @endif
        </ul>
	</div>
	<ul class="nav">
	</ul>
	<em class="control pre"></em>
	<em class="control next"></em>
</div>
<article><p>{{$project->project_desc}}</p></article>

            <article>
                <h4>项目亮点</h4>
                <p>
                    @if($lightspot = $project->project_lightspot)
                        {{$lightspot}}
                    @else
                        暂无数据
                    @endif
                </p>
            </article>
            <article>
                <h4>行业前景</h4>
                <p>
                    @if($future = $project->project_future)
                        {{$future}}
                    @else
                        暂无数据
                    @endif
                </p>
            </article>

            <div class="links" style="display: block;">
                <h4>相关网址</h4>
                <ul>
                    @if($id = $project->id)
                        @if($webLink = $project->getProjectLink($id , 'web'))
                            <li>网站：<a href="{{$webLink}}">{{$webLink}}</a></li>
                        @endif
                        @if($iphoneLink = $project->getProjectLink($id , 'ios'))
                            <li>Iphone下载链接：<a href="{{$iphoneLink}}">{{$iphoneLink}}</a></li>
                        @endif
                        @if($androidLink = $project->getProjectLink($id , 'android'))
                            <li>Android下载链接：<a href="{{$androidLink}}">{{$androidLink}}</a></li>
                        @endif
                        @if($ipadLink = $project->getProjectLink($id,'ipad'))
                            <li>Ipad下载链接：<a href="{{$ipadLink}}"  >{{$ipadLink}}</a></li>
                        @endif
                        @if( !$webLink && !$iphoneLink && !$androidLink && !$ipadLink)
                            <li>暂无网站链接</li>
                        @endif
                    @endif
                </ul>
            </div>
            <div class="milestone">
                <h4>里程碑</h4>
                <ul>
                    @if($milestones = $project->projectMilestone)
                        @foreach($milestones as $key=>$milestone)
                            <li><time>{{date('Y-m',strtotime($milestone->mil_time))}}</time><i></i><em>{{$milestone->mil_desc}}</em></li>
                        @endforeach
                    @else
                        <li>暂无数据</li>
                    @endif
                </ul>
            </div>
        </section>
        <section class="commpany">
            <h3><i>公司信息</i></h3>
            <ul>
                <li>公司名称：
                    @if($company = $project->company_name)
                        <em>{{$company}}</em>
                    @else
                        <em>暂无数据</em>
                    @endif
                </li>
                <li>成立时间：<em>
                        @if($create_time = $project->create_time)
                            {{date('Y-m',strtotime($create_time))}}
                        @else
                            {{date('Y-m',strtotime($project->created_at))}}
                        @endif
                    </em></li>
                <li>公司地址：<em>
                        @if($project->province || $project->city)
                            {{$project->province}} {{$project->city}}
                        @else

                        @endif
                    </em></li>
                {{--<li>公司状态：--}}
                    {{--<em>--}}
                        {{--@if($project_status = $project->project_status)--}}
                            {{--{{$project_status}}--}}
                        {{--@else--}}
                            {{--暂无数据--}}
                        {{--@endif--}}
                    {{--</em>--}}
                {{--</li>--}}
                <li>发展阶段：
                    <em>
                        @if($phase = $project->phase)
                            {{$phase->phase}}
                        @else
                            暂无数据
                        @endif
                    </em>
                </li>
                <li>项目领域：
                    @if($fields = $project->project_x_fields)
                        @foreach($fields as $field)
                            <em>{{$field->field}}</em>
                        @endforeach
                    @else
                        <em>暂无数据</em>
                    @endif
                </li>
                <li class="tab">项目标签：
                    @if($tags = $project->project_x_tags)
                        @foreach($tags as $tag)
                            @if($tag->tag != '')
                                <a href="#">{{$tag->tag}}</a>
                            @endif
                        @endforeach
                    @else
                        暂无数据
                    @endif
                </li>
            </ul>
        </section>
		<section class="state">
			<h3><i>融资状态</i></h3>
			<div class="wrap">
                @if($logs = $project->getInvestLogByProjectId($project->id))
                @foreach($logs as $log)
				<div class="col_1 c-2">
					<div>
						<div class="row_1">
							<p>@if($log->invest_account)￥{{$log->invest_account}}万@else 暂无数据 @endif</p>
							<p class="f_r">
								<time>@if($time = $log->invest_time){{date('Y-m' , strtotime($time))}}@endif</time>
								<i>A轮</i>
							</p>
						</div>
						{{--<div class="row_2">--}}
							{{--<dl>--}}
								{{--<dt><a href="#"><img src="images/banner_1.png" /></a></dt>--}}
								{{--<dd>蓝驰创投-朱天宇</dd>--}}
							{{--</dl>--}}
						{{--</div>--}}
					</div>
				</div>
                @endforeach
                @endif

			</div>
		</section>

        <!--团队介绍-->
        <section class="team">
            <h3><i>团队介绍</i></h3>
            <div class="leader">
                <p><em class="title">创始人CEO</em></p>


                @if($teams = $project->project_x_team()->where('is_founder' ,1)->get())
                    @foreach($teams as $team)
                    <dl>
                        <dt><a href="#"><img src="{{route('Api.ProjectTeamLogo.Show',['id'=>$team->photo_id])}}" alt="成员" /></a></dt>
                        <dd>
                            <a href="#">{{$team->real_name}}</a></i>
                            <em class="job_title">{{$team->position}}</em>
                            <p class="desc">
                                {{$team->province}}
                            </p>
                        </dd>
                    </dl>
                    @endforeach
                @endif



            </div>
            <div class="members">
                <p><em class="title">创始管理团队</em></p>


                    @if($teams = $project->project_x_team()->where('is_founder' ,0)->get())
                        @foreach($teams as $key=>$team)
                            <dl><dt><a href="#"><img src="{{route('Api.ProjectTeamLogo.Show',['id'=>$team->photo_id])}}" alt="成员" /></a></dt>
                            <dd>
                                <a href="#">{{$team->real_name}}</a>
                                <em class="job_title">{{$team->position}}</em>
                                <p class="desc">
                                    {{$team->province}}
                                </p>
                            </dd></dl>
                        @endforeach
                    @endif

            </div>
        </section>
    </div>
        <div class="r_col">


            <section class="col-2">
                <div>
                    <ul>
                        <li class="li-1">项目数据</li>
                        <li class="li-2">项目总览</li>
                        <li class="li-3">公司信息</li>
                        <li class="li-4">融资状态</li>
                        <li class="li-5">团队介绍</li>
                    </ul>
                </div>
            </section>
        </div>
    </div>
</div>
<!--页面弹出层-->
<!--约谈-->
<div class="talk hide_">
    <div>
        @if($project && $userInfo)
            <p>您确定要约谈 <b>"{{$project->company_name}}公司{{$userInfo->position}}{{$userInfo->realname}}"</b> 吗？</p>
            <input type="hidden" id="toUserId" value="{{$project->user_id}}" />
            <em>约谈期间请保持手机畅通</em>
            <span>
        <button class="sure-btn">确定</button>
        <button class="close-btn">取消</button>
    </span>
        @endif
    </div>
</div>

    <!--认证投资人-->
    <div class="invstor hide_">
        <div>
            <p>您还不是投资人，只有认证投资人才能约谈哦！</p>
		<span>
			<button class="sure-btn">认证投资人</button>
			<button class="close-btn">取消</button>
		</span>
        </div>
    </div>


<div class="mirror"></div>
</main>
<script type="text/javascript" >
var jiathis_config={
    hideMore:false
}
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END -->
@endsection
